<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="parent">
        <div class="child">1</div>
        <div class="child">2</div>
        <div class="child">3</div>
    </div>

    <script>

        const parent = document.querySelector('.parent');
        const children = document.querySelectorAll('.child');

        parent.addEventListener('click', function () {
            alert('我是你爹');
        });

        for (const child of children) {
            child.addEventListener('click', function (e) {
                e.stopPropagation();
                alert('我是我');
            });
        }

    </script>
</body>
</html>